<template>
  <div class="swich-box">
    <div
      class="swich-item"
      :class="{ cur: modeType == index }"
      v-for="(item, index) in modeList"
      :key="index"
      @click="handleChangeMode(index)"
    >
      {{ item.name }}
    </div>
  </div>
</template>
<script setup lang="ts">
import { ref } from "vue";
import * as hooks from "@/hooks/useTestHooks";
const modeType = ref(0);
const modeList = ref([
  {
    name: "组装模式",
  },
  {
    name: "调试模式",
  },
]);

const handleChangeMode = (index: number) => {
  modeType.value = index;
  hooks.useHandleChangeMode(index);

};
</script>
<style lang="less" scoped>
.swich-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: RGBA(242, 243, 245, 1);
  border-radius: 8px;
  height: 32px;
  overflow: hidden;
  .swich-item {
    width: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: PingFangSC, PingFang SC;
    font-weight: 400;
    font-size: 12px;
    color: #595959;
    height: 32px;
    &.cur {
      background: #2776ff;
      color: #ffffff;
      border-radius: 8px;
    }
  }
}
</style>
